package com.cyl.config;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;


public class JavaLongToStringConvert implements Converter<Long>{
	    
	@Override
    public WriteCellData<?> convertToExcelData(Long value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
        if(value==null) {
            return new WriteCellData<>("");
        }
        return new WriteCellData<>(value.toString());
    }
   
	@Override
    public Class<Long> supportJavaTypeKey() {
        return Long.class;
    }
 
    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return CellDataTypeEnum.NUMBER;
    }

}